package com.xxl.controller.impl;

import com.xxl.controller.UserControllerApi;
import com.xxl.dto.User;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

/**
 * @author xxl
 * @date 2023/3/18
 */
@RestController
@Tag(name = "实现了UserControllerApi接口的控制器类",description = "用户的操作")
public class UserController implements UserControllerApi {

    @Override
    @GetMapping("user/login")
    public String login(String username,String password) {
        return "登录成功";
    }

    @Override
    @GetMapping("admin/queryAllUser")
    public List<User> queryAllUser() {
        User user1 = new User("xxl","打代码");
        User user2 = new User("wyx","打代码");
        ArrayList<User> users = new ArrayList<>();
        users.add(user1);
        users.add(user2);
        return users;
    }
}
